package com.zjq.designpatterns.behaviors.iterator.code;/*
 * 版权信息: 北京千⾥马网信科技有限公司</br>
 * Copyright ©2008-2018. All rights reserved. 京ICP备16007318号
 */

import java.util.ArrayList;
import java.util.List;

/**
 * @author jessie
 * @version 1.0
 * @date 2021/1/24
 */
public class CourseAggregateImpl implements CourseAggregate{
    private List courseList;

    public CourseAggregateImpl() {
        courseList = new ArrayList();
    }

    @Override
    public void addCourse(Course course) {
        courseList.add(course);
    }

    @Override
    public void removeCourse(Course course) {
        courseList.remove(course);
    }

    @Override
    public CourseIterator getCourseIterator() {
        return new CourseIteratorImpl(courseList);
    }
}
